﻿<UserControl x:Class="NorthernLights.Controls.Notification"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
             mc:Ignorable="d"
             FontFamily="{StaticResource PhoneFontFamilyNormal}"
             FontSize="{StaticResource PhoneFontSizeSmall}"
             Foreground="{StaticResource PhoneForegroundBrush}"
             d:DesignHeight="100"
             d:DesignWidth="480">

    <Grid x:Name="LayoutRoot"
          Width="Auto"
          Height="Auto"
          Background="{Binding Color}"
          HorizontalAlignment="Stretch"
          VerticalAlignment="Top"
          Opacity="0">
        <toolkit:GestureService.GestureListener>
            <toolkit:GestureListener Tap="OnTap" />
        </toolkit:GestureService.GestureListener>

        <TextBlock Text="{Binding Message}"
                   TextWrapping="Wrap"
                   Margin="12">Warning</TextBlock>

        <VisualStateManager.VisualStateGroups>
            <VisualStateGroup x:Name="CommonStates">
                <VisualState x:Name="Enter">
                    <Storyboard Completed="EnterStoryboardCompleted">
                        <DoubleAnimation Storyboard.TargetName="LayoutRoot"
                                         Storyboard.TargetProperty="Opacity"
                                         From="0"
                                         To="1"
                                         Duration="0:0:0.5"
                                         AutoReverse="False" />
                    </Storyboard>
                </VisualState>
                <VisualState x:Name="Normal" />
                <VisualState x:Name="Exit">
                    <Storyboard Completed="ExitStoryboardCompleted">
                        <DoubleAnimation Storyboard.TargetName="LayoutRoot"
                                         Storyboard.TargetProperty="Opacity"
                                         From="1"
                                         To="0"
                                         Duration="0:0:0.5"
                                         AutoReverse="False" />
                    </Storyboard>
                </VisualState>
            </VisualStateGroup>
        </VisualStateManager.VisualStateGroups>
    </Grid>
</UserControl>
